/**
 * 
 * If you have edited the file, please update
 * all the last-modified fields manually. Thanks!
 *
 * @last-modified by: 
 * @last-modified date: 
 * @last-modified time: 
 *
 * @author Swee Zhi
 * @date-created Sep 7, 2011    @time-created 3:13:51 AM
 *
 * @project: 
 * @module: 
 * @institution: 
 *
 */
package entity;

import java.io.Serializable;
//Team T32
import java.util.ArrayList;
import java.util.List;
//Team T32
import java.util.Date;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

@Entity(name="TouristAcct")
public class TouristAccountEntity extends UserAccountEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    
//    private boolean inactivationStatus;

    @OneToOne(cascade={CascadeType.PERSIST})
    private TouristEntity tourist;

        //Team T32
    private double point;
    @OneToMany(mappedBy = "tourist")
    private List<TransactionsEntity> transactions = new ArrayList<TransactionsEntity>();
    @OneToMany(mappedBy = "tourist")
    private List<ReservationEntity> reservation = new ArrayList<ReservationEntity>();
    @OneToMany(mappedBy = "tourist")
    private List<RedemptionItemEntity> redemptionItem = new ArrayList<RedemptionItemEntity>();
    //Added by Cong Dat
    @OneToMany(mappedBy = "tourist")
    private List<PurchasedGrouponEntity> purchasedGroupons = new ArrayList<PurchasedGrouponEntity>();
    //End Team T32
    public TouristAccountEntity() {
        super();
    }
    
    public void create(String username, String password, Date creationDate, Date passwordChangeDate) {
        super.setUsername(username);
        super.setPassword(password);
        super.setCreationDate(creationDate);
        super.setPasswordChangeDate(passwordChangeDate);
    }
    
    public void update(String password, Date passwordChangeDate) {
        super.setPassword(password);
        super.setPasswordChangeDate(passwordChangeDate);
    }

    public TouristEntity getTourist() {
        return tourist;
    }

    public void setTourist(TouristEntity tourist) {
        this.tourist = tourist;
    }
//
//    public boolean isInactivationStatus() {
//        return inactivationStatus;
//    }
//
//    public void setInactivationStatus(boolean inactivationStatus) {
//        this.inactivationStatus = inactivationStatus;
//    }

    //Team T32
    public List<TransactionsEntity> getTransactions() {
        return transactions;
    }

    public void setTransactions(List<TransactionsEntity> transactions) {
        this.transactions = transactions;
    }

    public List<ReservationEntity> getReservation() {
        return reservation;
    }

    public void setReservation(List<ReservationEntity> reservation) {
        this.reservation = reservation;
    }

    public List<RedemptionItemEntity> getRedemptionItem() {
        return redemptionItem;
    }

    public void setRedemptionItem(List<RedemptionItemEntity> redemptionItem) {
        this.redemptionItem = redemptionItem;
    }

    public List<PurchasedGrouponEntity> getPurchasedGroupons() {
        return purchasedGroupons;
    }

    public void setPurchasedGroupons(List<PurchasedGrouponEntity> purchasedGroupons) {
        this.purchasedGroupons = purchasedGroupons;
    }

    public double getPoint() {
        return point;
    }

    public void setPoint(double point) {
        this.point = point;
    }
    //Team T32
}
